package com.hqx.oop;

/**
 * OOP（面向对象编程思想的落地实现）
 * @author hqx
 * @version 2021-06-24 v1.0
 */
public class OOPTest {
    public static void main(String[] args) {
        Person p = new Person();
        p.name = "hqx";
        p.age = 23;
        p.isMale = true;
        p.eat();
        p.sleep();
        p.work("程序员");
    }

}
class Person {
    String name;
    int age;
    boolean isMale;

    public void eat() {
        System.out.println("吃饭");
    }

    public void sleep() {
        System.out.println("睡觉");
    }

    public void work(String profession) {
        System.out.println("工作是"+profession);
    }
}
